package cn.edu.nju.ws.sview.reasoning;

/**
 * Variable
 * 
 * @author Gong Cheng
 * @author Gong Saisai
 */
public class Variable extends Term {
	private String symbol = null;
	/**
	 * variable
	 * 
	 * @param symbol
	 *           variable
	 */
	public Variable(String symbol) {
		this.symbol = symbol;
	}

	/**
	 * 
	 * @return variable
	 */
	public String getSymbol() {
		return this.symbol;
	}

	public boolean equals(Object variable) {
		if (variable instanceof Variable) {
			Variable variableO = (Variable) variable;
			if (this.symbol.equals(variableO.symbol)) {
				return true;
			}
		}
		return false;
	}

	public int hashCode() {
		return this.symbol.hashCode();
	}

	public String toString() {
		return "?" + this.symbol;
	}
}